﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class Transform3DEffectData : EffectOneSourceData
    {

        private float amount = 1f;
        private float angle;
        private Matrix4x4 transformMatrix;
        private CanvasImageInterpolation interpolationMode;
        private EffectBorderMode borderMode;



        public EffectBorderMode BorderMode { get => borderMode; set { borderMode = value; OnPropertyChanged(); SetIsChanges(); } }
        public CanvasImageInterpolation InterpolationMode { get => interpolationMode; set { interpolationMode = value; OnPropertyChanged(); SetIsChanges(); } }
        public Matrix4x4 TransformMatrix { get => transformMatrix; set { transformMatrix = value; OnPropertyChanged(); SetIsChanges(); } }
        #region 属性

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;

            
            var effect = new Transform3DEffect()
            {
                Source = source,
                BorderMode = BorderMode,
                InterpolationMode = InterpolationMode,
                TransformMatrix = TransformMatrix
            };
            return effect;
        }


    }
}